<%-- 
    Document   : gererprojets
    Created on : 28 févr. 2012, 11:36:43
    Author     : tidiane
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
            <link rel ="stylesheet" type ="text/css" href = "libs/bootstrap/css/bootstrap.css" />
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
            </script>
            <script type = "text/javascript" src = "http://twitter.github.com/bootstrap/assets/js/bootstrap-modal.js" ></script>
            <script type = "text/javascript">
                $(document).ready(function (){
                    $("#save-risque").click(function (){
                        // validation 
                        if ($("#risque").val() != "" && $("#probabilite").val() != "" && $("#impact").val() != "" && $("#plan_b").val() != "" ){
                            $("#nouveau-risque").submit();
                        } 
                        else{
                            alert (" Donnez les informations du projet ! ");
                        }
                    })
                })
            </script>
    </head>
    <body>
        <div id="creerprojets" >
        <div class="modal-header">
            <a class="close" data-dismiss="modal" >&times;</a>
            <h3>
                Création d'un nouveau risque 
            </h3>
        </div>
        <div class="modal-body" >
            <form id ="nouveau-risque" method = "POST" action = "creerrisque" class="form-horizontal">
                <fieldset>
                <div class="control-group">
                    <label class="control-label" for="projet"> Projet </label>
                    <div class="controls">
                        <select class="input-xlarge" id="projet" name ="projet">
                            <c:forEach var = "projet" items ="${projets}">
                                <option> ${projet.titre} </option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="risque"> Risque </label>
                    <div class="controls">
                    <input type="text" class="input-xxlarge" id="risque" name ="risque">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="probabilite"> Probabilité </label>
                    <div class="controls">
                    <input type="text" class="input-mini" id="probabilite" name ="probabilite">
                    <span class="help-inline">Entier entre 1 et 5</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="impact"> Impact </label>
                    <div class="controls">
                    <input type="text" class="input-xlarge" id="impact" name ="impact">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="plan_b"> Plan B </label>
                    <div class="controls">
                    <input type="text" class="input-xlarge" id="plan_b" name ="plan_b">
                    </div>
                </div>
                </fieldset>
            </form>
        </div>
            <div class ="modal-footer">
                <input id = "save-risque" class ="btn btn-primary"type="button" value = "Enregister">
            </div>
        </div>
    <body>
</html>